package com.my.study.service.Impl;

import com.my.study.convert.OperateLogConvert;
import com.my.study.dto.OperateLogDTO;
import com.my.study.mapper.OperateLogMapper;
import com.my.study.service.OperateLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class OperateLogServiceImpl implements OperateLogService {

    @Autowired
    private OperateLogMapper operateLogMapper;
    @Autowired
    private OperateLogConvert operateLogConvert;

    @Transactional(rollbackFor = Exception.class)
    @Override
    public int addOperateLog(OperateLogDTO operateLog) {
        return operateLogMapper.addOperateLog(operateLogConvert.toEntity(operateLog));
    }
}
